Skip to content

complete assignment 1 - #1

Open
YariShukla wants to merge 3 commits into
mainfrom
assignment-1
Open

complete assignment 1#1
YariShukla wants to merge 3 commits into
mainfrom
assignment-1

Conversation

@YariShukla

Copy link
Copy Markdown
Owner

What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)

I added the anagram_checker function for Assignment #1. The function checks whether two strings are anagrams of each other. I also added the is_case_sensitive option to allow the function to either consider or ignore capitalization.

What did you learn from the changes you have made?

I learned how to work with Python functions, strings, conditional statements, and the sorted() function. I also learned how changing the case of strings affects comparisons and how to use a boolean parameter to control the behaviour of a function.

Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?

I considered comparing the characters in the two words using a different approach, such as counting how many times each character appears. I decided to use sorted() because it provides a simple and concise way to compare the characters in two strings.

Were there any challenges? If so, what issue(s) did you face? How did you overcome it?

One challenge was understanding how to handle uppercase and lowercase letters depending on the is_case_sensitive option. I overcame this by converting both strings to lowercase when case sensitivity is turned off, while leaving the strings unchanged when case sensitivity is turned on.

How were these changes tested?

I tested the function in JupyterLab using the examples provided in the assignment. I tested both case-sensitive and case-insensitive comparisons, including:

  • anagram_checker("Silent", "listen", False)True
  • anagram_checker("Silent", "listen", True)False
  • anagram_checker("Silent", "Listen", True)False
  • anagram_checker("Silent", "Night", False)False
  • anagram_checker("night", "Thing", False)True

All test cases executed successfully without errors.

A reference to a related issue in your repository (if applicable)

Not applicable.

Checklist

  • I can confirm that my changes are working as intended

@KasraVakiloroayaei KasraVakiloroayaei left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A1: Incomplete

Missing solutions. Please refer to screenshot

Image

@YariShukla

Copy link
Copy Markdown
Owner Author

Hi @KasraVakiloroayaei I have updated assignment_1.ipynb with the complete solutions and output cells for both Part 1 and Part 2. Could you please re-review when you have a moment? Thanks!

@juliagallucci juliagallucci left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submission is now complete!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants